The present invention relates to computer graphics, and more particularly to compression of textures and other similar images used typically in three-dimensional computer graphics.
A commonly used technique in rendering a three-dimensional (3D) scene to have a more realistic look is to apply textures on the surfaces of 3D objects. A texture can be defined as an ordinary two-dimensional image, such as a photograph, that is stored in a memory as an array of pixels (or texels, to separate them from screen pixels). Along with the increase in the quality of displays and display drivers as well as in the processing power of graphics accelerators used in computers, the demand for even better image quality in computer graphics also continues. As a general rule, the more memory space and bandwidth can be spent on textures, the better the image quality can be achieved in the final 3D scene.
A traditional way of representing textures is to store the color of each pixel as a combination of three primary colors: red, green and blue (RGB). Typically 8 bits are allocated for each component, yielding 24 bits per pixel (24 bpp). This is called the RGB8 format. Other popular formats include RGB4 and RGB565 that sacrifice color gamut in favor of using less memory space. A problem with the traditional formats of representing colors is that they provide a rather limited dynamic range for colors, for example in comparison to a human's capability of simultaneously perceiving luminance across over 4 dB (i.e. a contrast ratio of 1:104=1:10 000). Accordingly, textures created with these traditional methods are generally called low dynamic range (LDR) textures. The de facto standard in the field of LDR textures is DXTC (DirectX Texture Compression), also known as S3TC, which is further described in U.S. Pat. No. 6,658,146. Other similar methods include FXT, FLXTC, and ETC (Ericsson Texture Compression), the last one being disclosed also in WO05/059836.
In order to meet the demand for better image quality in computer graphics, image formats that are able to represent the entire dynamic range of luminance in the real world have been developed. These image formats are called high dynamic range (HDR) formats. The emerging de facto standard for storing and manipulating high dynamic range images is OpenEXR, which uses a 16-bit or a 32-bit floating-point representation for the color components. The dynamic range of OpenEXR is more than 11 dB when using the 16-bit variant and up to 76 dB when using the 32-bit variant. The 16-bit format is sufficient for most purposes, yielding a practical bit rate of 48 bpp.
A problem with the HDR textures is that they consume double the amount of memory and bus bandwidth compared to traditional LDR formats. Furthermore, very effective compressed formats exist for LDR textures that can bring the bit rate down to one sixth of the original. Thus, the difference between HDR and LDR textures, in terms of memory and bus bandwidth consumption, is a factor of 12 or more.
The OpenEXR standard supports several compression methods, like PIZ, ZIP, RLE and PXR24, but they all involve a technical shortcoming that none of them allow random access to the compressed data, which is absolutely crucial in mapping textures onto 3D objects. The graphics hardware needs to be able to decompress any given pixel in the image without having to decompress the entire image. Also the decompression must be very fast, since contemporary hardware can fetch and decompress billions of LDR texels per second, and any proposed HDR texture compression scheme should achieve performance that is at least close enough to that.
Ordinary image compression techniques applicable to HDR images as well, such as JPEG and PNG, are similar to the OpenEXR formats in that random access to individual pixels is not possible. In order to access a single pixel e.g. in a JPEG image, the entire image up to that pixel must be decompressed. This is obviously too slow, because millions or even billions of texels must be accessed per second in contemporary computer graphics, like in 3D games.
Accordingly, the conventional image compression techniques are useful in reducing the size of textures for permanent storage and transmission over a network, but they are poorly applicable for reducing the run-time memory space and bandwidth consumption in a decompressor.
The applicant's previous patent application U.S. Ser. No. 11/241,854 describes an image compression method, in which HDR texture image are appropriately scaled such that the image data can be compressed and decompressed according to known LDR techniques. However, in certain cases the scaling introduces too much inaccuracy into the image data. Thus, there is a need for a more accurate image compression method.